fix(desktop): Windows FFmpeg from BtbN GitHub + detect bin/ layout (#248) - #249
Merged
Conversation
) Switch the Windows FFmpeg download from gyan.dev (single US mirror, ~0.1 MB/s for the reporter) to BtbN's GitHub build, served via GitHub's CDN. Uses the pinned asset ffmpeg-n8.1-latest-win64-gpl-8.1.zip and verifies it against BtbN's combined checksums.sha256 (one file listing every asset), replacing the old per-file {url}.sha256 companion fetch. Fails closed if the archive is not listed. Custom STEMDECK_FFMPEG_URL overrides still skip verification. Also detect a manually-placed FFmpeg under data/ffmpeg/bin/ (the upstream folder layout) in addition to the flat data/ffmpeg/ location, so users who drop in their own build are honored instead of triggering a download. Detection now flows through resolve_existing_ffmpeg across probe_runtime, ffmpeg_dir_if_present, and ensure_ffmpeg; write_setup_config records ffprobe next to the resolved ffmpeg.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #248.
Problem
Two issues reported for Windows FFmpeg setup:
data/ffmpeg/bin/ffmpeg.exe(the upstream folder layout), but detection only checkeddata/ffmpeg/ffmpeg.exe, so it downloaded anyway.Changes (all in
desktop/src-tauri/src/main.rs)1. Windows FFmpeg download: gyan.dev -> BtbN GitHub
ffmpeg-n8.1-latest-win64-gpl-8.1.zipfromBtbN/FFmpeg-Builds, served via GitHub's CDN (fast worldwide, including the EU).checksums.sha256(every asset as<hash> <filename>lines) instead of gyan's per-file{url}.sha256. A new pure helpersha256_from_checksumsextracts the line for our archive. Fails closed if the archive is not listed.STEMDECK_FFMPEG_URLoverride still skips verification (unchanged behavior).ffmpeg.exe/ffprobe.exeanywhere in the archive, so BtbN'sbin/layout and the extraffplay.exeare handled.GPL is fine here because StemDeck shells out to FFmpeg as a separate process (mere aggregation), not linking it.
2. Detect a manually-placed FFmpeg under
data/ffmpeg/bin/resolve_existing_ffmpegchecks theSTEMDECK_FFMPEGoverride, then flatdata/ffmpeg/, thendata/ffmpeg/bin/, returning the first that exists.probe_runtime,ffmpeg_dir_if_present, andensure_ffmpeg, so a manually-placed build is honored instead of triggering a download.write_setup_confignow recordsffprobenext to the resolvedffmpeg.Scope
Windows only (macOS/evermeet and Linux/johnvansickle sources unchanged). The
bin/fallback is cross-platform since it is harmless elsewhere.Testing
cargo fmt --check: clean.cargo test: 11 passed, including 2 new tests (sha256_from_checksums_picks_matching_line,resolve_existing_ffmpeg_prefers_flat_then_bin).#[cfg(windows)]and could not be built on the macOS dev box (cross-compile fails on theringC toolchain); it builds in the Windows release job. Manual Windows checks still pending: real first-run download from BtbN, and bin/ detection without a download.